package TEst;

import java.util.Arrays;

/**
 * @author 李某
 * * @date 2021/11/22
 * *物有本末，事有终始。知其先后者，则近道矣！
 * *荷花开满池塘的前一天还是半塘荷花半塘云。
 */
public class JieXi {

    public static void main(String[] args) {
        JieXi.JieXi();
    }


    @Override
    public boolean equals(Object obj) {
        return super.equals(obj);
    }

    public static void JieXi(){
        String url = "http://localhost:8080/" +
                "itygfiytgfviytgfv_war_exploded/" +
                "%E8%8F%9C%E7%8B%972%EF%BC%9F?" +
                "name=2332905549&pwd=010321";
        
        String[] strs = url.split("\\?");

        System.out.println(Arrays.toString(strs));

        String[] strs1 = strs[1].split("\\&");

        System.out.println(Arrays.toString(strs1));

        String firstname = null;
        String nameValue = null;
        String pwd = null;
        String passworld = null;

        for (String str : strs1){

            String[] name = str.split("\\=");

            if (name[0].equals("name")){
                firstname = name[0];
                nameValue = name[1];
            }else if(name[0].equals("pwd")){
                pwd = name[0];
                passworld = name[1];
            }
            

            System.out.println(str);

            System.out.println(firstname);
            System.out.println(nameValue);
            System.out.println(pwd);
            System.out.println(passworld);

        }

    }

}
